package unifor.mia.redes.relprotocol.msg;

import java.io.Serializable;

public final class Mensagem implements Serializable{

	private static final long serialVersionUID = 5661753860957334213L;

	private String header;
	private String body;
	private String hash;

	private long 	seq = 0l;
	private Boolean BOT = false; //begin of transmission
	private Boolean EOT = false; //end of transmission
	
	public Mensagem(){
		super();
	}
	
	public Mensagem(String header, String body){
		super();
		setHeader(header);
		setBody(body);
	}
	
	public void setHeader(String header) {
		this.header = header;
	}
	
	public String getHeader() {
		return header;
	}
	
	public void setBody(String body) {
		if(body == null){
			body = "";
		}
		this.body = body ;
	}
	
	public String getBody() {
		return body;
	}

	public String getHash() {
		return hash;
	}

	public void setHash(String hash) {
		this.hash = hash;
	}

	public long getSeq() {
		return seq;
	}

	public void setSeq(long seq) {
		this.seq = seq;
	}

	public Boolean starting() {
		return BOT;
	}

	public void setStarting() {
		BOT = true;
		EOT = false;
	}

	public Boolean end() {
		return EOT;
	}

	public void setEnding() {
		EOT = true;
		BOT = false;
	}
	
}
